class Solution {
public:
    int removeElement(vector<int>& nums, int val) {
        int index = 0;
        int length = nums.size();
        for(int i = 0; i < length; i++)
        {
            if(val != nums[i])
            {
                nums[index] = nums[i];
                index += 1;
            }
            else
            {
                continue;
            }
        }
        return index;
    }
};